package com.hr.User.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tangzc.mpe.autotable.annotation.Column;
import com.tangzc.mpe.autotable.annotation.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * @author DSL
 * @create 2024-10-28 16:01
 */
@Entity//实体类
@Data//自动生成getter和setter方法
@Table//表名
public class UserTable{
    @Id
    @Column(comment = "id",notNull = true)
    @TableId(type = IdType.AUTO)
    private Long id;

    @Column(comment = "用户名",notNull = true)
    private String userName;

    @Column(comment = "密码",notNull = true)
    private String password;

    @Column(comment = "邮箱",notNull = true)
    private String email;

    @Column(comment = "用户电话",notNull = true)
    private String phone;

    @Column(comment = "用户头像")
    private String avatarUrl;

    @Column(comment = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "Asia/Shanghai")//时间格式
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")//前端传值时间格式
    private LocalDateTime createdDate;

    @Column(comment = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "Asia/Shanghai")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime updatedDate;
}
